#!/usr/bin/env python
# -*- coding: utf-8 -*-

import shutil
import sys
from time import strftime

# backup base de dados
db_backup = "database/db.sqlite-%s" % strftime('%Y%m%d%H%M%S')
shutil.copy2('database/db.sqlite', db_backup)

atualiza = ['VERSION', 'gmo-pneus.py']
for i in atualiza:
	file_dw = 'http://inf.ufrgs.br/~gmoliveira/%s' % (i)
	url = urllib2.urlopen(file_dw)
	new = open(i, 'wb')
	new.write(url.read())
	url.close()
	new.close()
